from selenium.webdriver.common.by import By

class AdminPUUserLocator:

     #  Platform User->User页面的用户邮箱信息栏
     platform_user_account_email = (By.XPATH, '(//*[@class="config-theme-system-user-primary-font email___3vX7e"])/button/span')
     #  Platform User->User的用户具体信息页面
     platform_user_member_specific_info_page = (By.CSS_SELECTOR, '[class="cre-page-container-spin"]')
     #  Platform User->User的用户具体信息的overview tab
     platform_user_member_info_overview_tab = (By.CSS_SELECTOR, '[id="rc-tabs-0-tab-1"]')
     #  Platform User->User的用户具体信息的User Group tab
     platform_user_member_info_user_group_tab = (By.CSS_SELECTOR, '[id="rc-tabs-0-tab-2"]')
     #  Platform User->User的用户具体信息的Audit tab
     platform_user_member_info_audit_tab = (By.CSS_SELECTOR, '[id="rc-tabs-0-tab-3"]')
     #  Platform User->User的用户具体信息的overview tab的基本信息页Basic Information标题
     platform_user_member_basic_info_overview_title = (By.CSS_SELECTOR, '[class="antd4-descriptions-title"]')
     #  Platform User->User的用户具体信息的User Group tab的基本信息页User Group字段
     platform_user_member_info_user_group_field = (By.XPATH, '(//*[@class="antd4-table-cell"])[1]')
     #  Platform User->User的用户具体信息的User Group tab的基本信息页Members字段
     platform_user_member_info_members_field = (By.XPATH, '(//*[@class="antd4-table-cell"])[2]')
     #  Platform User->User的用户具体信息的Audit tab的基本信息页Account Email字段
     platform_user_member_info_audit_account_email_field = (By.XPATH, '(//*[@class="antd4-table-thead"])/tr/th[1]')
     #  Platform User->User的用户具体信息的Audit tab的基本信息页Event Type字段
     platform_user_member_info_audit_event_type_field = (By.XPATH, '(//*[@class="antd4-table-thead"])/tr/th[2]/div/span[1]')
     #  Platform User->User的用户具体信息的Audit tab的基本信息页Remarks字段
     platform_user_member_info_audit_remarks_field = (By.XPATH, '(//*[@class="antd4-table-thead"])/tr/th[5]')
     #  Platform User->User的用户具体信息的Audit tab的基本信息页总数字段
     platform_user_member_info_audit_detail_tatal = (By.XPATH, '//*[@class="antd4-spin-nested-loading"]/div/ul/li[1]')

     paltform_user_tab=(By.XPATH,"//div[contains(@data-menu-id,'MANAGEMENT_PLT_PLATFORM_USER')]/span/div")

     user_tab=(By.XPATH,"//li[contains(@data-menu-id,'USER_PLATFORM_USER')]/span/div")

     # invite_new_user
     invite_new_user = (By.XPATH, "//form[contains(@class,'inline')]//button[contains(@class,'primary')]")

     # invite_new_user_email
     new_user_email = (By.CSS_SELECTOR, 'input[id="creForm_emails"]')

     # role_choose
     user_role_choose_list = (By.ID, 'creForm_role')

     # default_role
     default = (By.XPATH, "//div[contains(@class,'select-item-option-content')]")

     # org
     org_option = (By.ID, "creForm_organization")

     # org_optin
     def org_option_choose(self, title):
          org_option_choose = (By.CSS_SELECTOR, '[title="%s"]' % title)
          return org_option_choose

     # invite_new_user_ok_button
     invite_new_user_ok_button = (By.XPATH, "(//button[contains(@class,'btn-primary')])[2]")

     # user_role
     def role_option_choose(self,role_name):
           role_option_choose = (By.CSS_SELECTOR, '[title="%s"]' % role_name)
           return role_option_choose

     # 成功提示
     add_success_prompt = (By.XPATH, "//div[contains(@class,'antd4-message-success')]")

     #滚动条
     scroll=(By.CSS_SELECTOR,'[class="rc-virtual-list-scrollbar-thumb"]')

     # account_phone查询框
     account_phone_query_input = (By.ID, 'fuzzy')

     # 查询按钮
     account_phone_query_button = (By.XPATH, "//button[contains(@class,'antd4-input-search-button')]")

     # action_button
     action_button = (By.XPATH, "//span[contains(@class,'table-operation-ellipsis')]")

     # user删除按钮
     delete_user_button = (By.XPATH, '(//span[contains(@class,"antd4-dropdown-menu-title-content")])[6]')

     #operation
     operations=(By.XPATH, '(//span[contains(@class,"antd4-dropdown-menu-title-content")])')


     # 删除确认


     # 提交删除
     delete_confirm = (By.CSS_SELECTOR, '[class="antd4-modal-footer"]>:nth-child(2)')

     # status_filter
     status_filter = (By.XPATH, "(//span[contains(@class,'table-filter-trigger')])[1]")

     # 筛选项_inactive
     filter_inactive = (By.XPATH, '(//span[@class="antd4-checkbox"])[3]')

     # 确认选择项
     filter_ok = (By.XPATH, "//button[contains(@class,'btn-primary antd4-btn')]")

     # 状态
     status = (By.XPATH, "//span[contains(@class,'badge-status-text')]")

     # 重置密码按钮
     reset_password_button = (By.XPATH, "//button[contains(@class,'table-operation-btnLine-btn')]")

     # change password send
     change_pwd_send = (By.XPATH, "//button[contains(@class,'background-ghost')]")

     # change password_verification code_input
     change_password_verificationcode_input = (By.ID, 'creForm_verifyCode')

     # new_pwd
     new_pwd = (By.CSS_SELECTOR, '[autocomplete="new-password"]')

     # confirm_new_pwd
     confirm_new_pwd = (By.CSS_SELECTOR, '[id="creForm_confirmPassword"]')

     # reset_pwd_ok
     reset_pwd_ok = (By.XPATH, "(//button[contains(@class,'antd4-btn-primary')])[3]")

     #role选择
     role_options=(By.CSS_SELECTOR,'[class="antd4-select-item-option-content"]')

     # operation
     operation = (By.XPATH, '//span[contains(@class,"antd4-dropdown-menu-title-content")]')

     # edit_org_select
     edit_org_select = (By.XPATH, '//div[contains(@class,"elect-show-search")]')

     # edit_user_group
     edit_user_group = (By.XPATH, "//div[contains(@class,'select-show-search')]")

     # 选择usergroup
     def select_user_group(self, usergroup):
          user_group_ele = (By.CSS_SELECTOR, '[title="%s"]' % usergroup)
          return user_group_ele

     # edit_role
     edit_role = (By.XPATH, "(//span[contains(@class,'selection-item')])[2]")

     # 选择role
     def select_role(self, role):
          role_ele = (By.CSS_SELECTOR, '[title="%s"]' % role)
          return role_ele

     #platform_role
     platform_role=(By.CSS_SELECTOR, '[title="Platform Role:"]')

     # 加载转菊花
     loading_wait = (By.CSS_SELECTOR, '[class="antd4-spin-dot antd4-spin-dot-spin"]')

     # delete_org_ack
     delete_org_ack = (By.XPATH, '//div[@role="dialog"]//input/..')

     #member_delete_confirm
     member_delete_confirm=(By.XPATH,"//div[contains(@class,'modal-footer')]/button[2]")

     # 翻页
     page_total = (By.CSS_SELECTOR, '[class="antd4-pagination-total-text"]')


     # reset_pwd
     reset_pwd = (By.XPATH, '//button[contains(@class,"table-operation-btnLine-btn")]')

     # 列表字段
     list_columns = (By.CSS_SELECTOR, "tr th.antd4-table-cell")

     # status字段
     list_column_status = (By.CSS_SELECTOR, "tr th.antd4-table-cell span.antd4-table-column-title")

     # 展开status选项
     status_checkbox = (By.CSS_SELECTOR, "tr th.antd4-table-cell span[role='button']")

     # status选项
     status_checkbox_options = (By.CSS_SELECTOR, "span.antd4-dropdown-menu-title-content>span")

     # email_button
     email_button = (By.XPATH, "//button[contains(@class,'emailName')]")

     # reset password button
     reset_pwd_button = (By.XPATH, "//tr[contains(@class, 'antd4-table-row')]/td[8]//button")

     # 用户操作按钮
     user_options_button = (By.XPATH, "//span[contains(@class,'table-operation-ellipsis')]")

     # 展开的用户操作
     edit_organization_button = (By.XPATH, "(//li[contains(@class,'dropdown-menu-item-only-child')])[1]/span")
     edit_user_group_button = (By.XPATH, "(//li[contains(@class,'dropdown-menu-item-only-child')])[2]/span")
     edit_role_button = (By.XPATH, "(//li[contains(@class,'dropdown-menu-item-only-child')])[3]/span")
     lock_button = (By.XPATH, "(//li[contains(@class,'dropdown-menu-item-only-child')])[4]/span")
     unlock_button = (By.XPATH, "(//li[contains(@class,'dropdown-menu-item-only-child')])[5]/span")
     delete_button = (By.XPATH, "(//li[contains(@class,'dropdown-menu-item-only-child')])[6]/span")
     resend_button = (By.XPATH, "(//li[contains(@class,'dropdown-menu-item-only-child')])[7]/span")